package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.TLeaseManage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.THouseAssetsMapper;
import com.ruoyi.system.domain.THouseAssets;
import com.ruoyi.system.service.ITHouseAssetsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 房产资产Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-13
 */
@Service("THouseAssetsService")
public class THouseAssetsServiceImpl implements ITHouseAssetsService 
{
    @Autowired
    private THouseAssetsMapper tHouseAssetsMapper;

    public List<THouseAssets> getAssetsId(String type){
        THouseAssets tHouseAssets = new THouseAssets();
        tHouseAssets.setType(Long.valueOf(type));
        List<THouseAssets> list = tHouseAssetsMapper.selectTHouseAssetsList(tHouseAssets);
        return list;
    }

    /**
     * 查询房产资产
     * 
     * @param id 房产资产主键
     * @return 房产资产
     */
    @Override
    public THouseAssets selectTHouseAssetsById(Long id)
    {
        return tHouseAssetsMapper.selectTHouseAssetsById(id);
    }

    /**
     * 查询房产资产列表
     * 
     * @param tHouseAssets 房产资产
     * @return 房产资产
     */
    @Override
    public List<THouseAssets> selectTHouseAssetsList(THouseAssets tHouseAssets)
    {
        return tHouseAssetsMapper.selectTHouseAssetsList(tHouseAssets);
    }

    /**
     * 新增房产资产
     * 
     * @param tHouseAssets 房产资产
     * @return 结果
     */
    @Override
    public int insertTHouseAssets(THouseAssets tHouseAssets)
    {
        tHouseAssets.setCreateTime(DateUtils.getNowDate());
        return tHouseAssetsMapper.insertTHouseAssets(tHouseAssets);
    }

    /**
     * 修改房产资产
     * 
     * @param tHouseAssets 房产资产
     * @return 结果
     */
    @Override
    public int updateTHouseAssets(THouseAssets tHouseAssets)
    {
        tHouseAssets.setUpdateTime(DateUtils.getNowDate());
        return tHouseAssetsMapper.updateTHouseAssets(tHouseAssets);
    }

    /**
     * 批量删除房产资产
     * 
     * @param ids 需要删除的房产资产主键
     * @return 结果
     */
    @Override
    public int deleteTHouseAssetsByIds(String ids)
    {
        return tHouseAssetsMapper.deleteTHouseAssetsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除房产资产信息
     * 
     * @param id 房产资产主键
     * @return 结果
     */
    @Override
    public int deleteTHouseAssetsById(Long id)
    {
        return tHouseAssetsMapper.deleteTHouseAssetsById(id);
    }

    @Override
    public List<THouseAssets> selectTHouseAssetsListByIds(String ids) {
        return tHouseAssetsMapper.selectTHouseAssetsListByIds(Convert.toStrArray(ids));
    }
}
